const http = require("http");
let db = require("./db");
http.createServer((req,res)=>{
    res.setHeader("Access-Control-Allow-Origin", "*")//跨域
    res.setHeader('Content-Type', 'text/html; charset=utf-8');//设置乱码

    let sql = 'delete from user where password = "undefined"';
    db(sql,(err,result)=>{
        if(err){
            throw err
        }
        let data = {
            code:200,
            msg:"删除成功",
            data:result
        }
        res.end(JSON.stringify(data))
    })


}).listen(3002)
console.log(30002);